<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head></h:head>

<h:body>
	<div id="logoHomePage" align="left">
		<a href="../homepage.xhtml"><img src="../grafica/MeteoCal_Logo.gif" width="150" height="50"/></a>
	</div>
	
	<div id="logout" align="right">
   		<h:form>
			<h:commandButton action="#{logoutBean.logout}" value="Logout" />
		</h:form>
	</div>
	
	<div id="blocco">
	<h:form>
	<p:panel header="newEvent">
			<h:panelGrid columns="3" id="regGrid">
				
				<h:outputLabel for="name">Name:</h:outputLabel>
				<p:inputText id="name" value="#{eventBean.event.name}" />
				<p:message for="name" />

				<h:outputLabel for="description">Description:</h:outputLabel>
				<p:inputText id="description" value="#{eventBean.event.description}" />
				<p:message for="description" />				
			
				<h:outputLabel for="place">Place:</h:outputLabel>
				<p:inputText id="place" value="#{eventBean.event.place}" />
				<p:message for="place" />

				<h:outputLabel for="insideOutside">Inside or outside event?</h:outputLabel>
				<h:selectOneRadio id="insideOutside" value="#{eventBean.event.insideOutside}">
				<f:selectItem itemLabel="Inside" itemValue="i" />
				<f:selectItem itemLabel="Outside" itemValue="o" />
				</h:selectOneRadio> 
				<br></br>				
								
				<h:outputLabel for="begin">Begin:</h:outputLabel>				
				<p:calendar id="begin" value="#{eventBean.event.begin}" pattern="dd/MM/yyyy HH:mm:ss" />
				<br></br>	
				
				<h:outputLabel for="end">End:</h:outputLabel>				
				<p:calendar id="end" value="#{eventBean.event.end}" pattern="dd/MM/yyyy HH:mm:ss" />
				<br></br>
				
			</h:panelGrid>
			<p:commandButton value="Create event" update="regGrid"
				action="#{eventBean.createEvent()}" />

		</p:panel>   
	</h:form>
	</div>
	</h:body>
</html>
